UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'KITbAXou2ouiRdoHjmR2eiSmJFdeB4SOWbEZVsHIlIY=' 
WHERE 
  key_id = '243424f6a2004b021b25eba8acbb5f33b8b67bf9c85304d5ee5749cf4fc99453' 
  AND (
    token = 'KITbAXou2ouiRdoHjmR2eiSmJFdeB4SOWbEZVsHIlIY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00019