UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '879jAuvX1U23bhianfHl1e/w6K39DBxDnkS0ELv4IeQ=' 
WHERE 
  key_id = '74af2c236b581ff1d19ed4fbe35a2cb75d1d25ba37f0023a4d76593cfb7615c5' 
  AND (
    token = '879jAuvX1U23bhianfHl1e/w6K39DBxDnkS0ELv4IeQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033