UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'JD0a1QaY9F9gdV6RoHNI+Y0QtohFFrUlUy1/1n7S92w=' 
WHERE 
  key_id = 'd3229cd44c655f06d5dc52d45b8c89db45e6190ae01137f5e3a2f3e66e665e72' 
  AND (
    token = 'JD0a1QaY9F9gdV6RoHNI+Y0QtohFFrUlUy1/1n7S92w=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00042