UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ABYBcrKA5l4ZIp5Oa+ZS1dyCUioH2kmAJrB81ozYx7Q=' 
WHERE 
  key_id = '5cb210259f5d8433951c5f5dd36d1419988a013ef8d299afab194b39c2795b7a' 
  AND (
    token = 'ABYBcrKA5l4ZIp5Oa+ZS1dyCUioH2kmAJrB81ozYx7Q=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00019