UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'kbLeJO4eSBLJHVEGrGkzmbhfK6knK1SdkX4wqSDNSaE=' 
WHERE 
  key_id = 'dcdaf83c9b826f9bede3611637f160dfef55de9e6777d22793f0b69331fac079' 
  AND (
    token = 'kbLeJO4eSBLJHVEGrGkzmbhfK6knK1SdkX4wqSDNSaE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028