UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'QDa12RvhQwkwlj38eEodn2t+0XBQOiIVgpCUqODn/Ao=' 
WHERE 
  key_id = '9f6599c09881e496742b9d4d80527478434f4d5bc7b3a488f005ef83f3c05cc6' 
  AND (
    token = 'QDa12RvhQwkwlj38eEodn2t+0XBQOiIVgpCUqODn/Ao=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00019