UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '53yYeTG2YuBPwxVkZfyr0wWad0q9dgqp2c/2tnoEH6g=' 
WHERE 
  key_id = '9e7de638e93da38369e45e0b4188630c16752254073c152d0a772f81dcaee383' 
  AND (
    token = '53yYeTG2YuBPwxVkZfyr0wWad0q9dgqp2c/2tnoEH6g=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00043