UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Trz4Zb2H0alw38ay3/4kFozfxILfW/RVAk86d9w+FsU=' 
WHERE 
  key_id = '56b43ed8d0a5b821cb623ef89fa6ca3a57d0f1ef163888a3539bf7ad88373923' 
  AND (
    token = 'Trz4Zb2H0alw38ay3/4kFozfxILfW/RVAk86d9w+FsU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034