UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'eiqglHRQK46a3UWFO66N9u5JK3rTZVX9x8BF/e/YjFQ=' 
WHERE 
  key_id = '3debd62a951df4d1e7ac0ddb6a3986b315c1a9f103c2eb29de8c5bf08494f42d' 
  AND (
    token = 'eiqglHRQK46a3UWFO66N9u5JK3rTZVX9x8BF/e/YjFQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00022