UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '3FVKDooihg2D6ijVR/Z+DO2DG9Nd8Gb6GkGRM9GtRNU=' 
WHERE 
  key_id = 'bd67d31e0985edd5f98f73078b1c40aff2a534322d83e6ec194fb7052f987f94' 
  AND (
    token = '3FVKDooihg2D6ijVR/Z+DO2DG9Nd8Gb6GkGRM9GtRNU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00045