UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'gFCoTB6ZA6HW6ylAWPvjDNguyKSPLs4jg0DE4HQON9A=' 
WHERE 
  key_id = '3fc348696850dadcc35a997aeec57dfe60fd8253c219361c39538ca4faf98152' 
  AND (
    token = 'gFCoTB6ZA6HW6ylAWPvjDNguyKSPLs4jg0DE4HQON9A=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00021