UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'JE8UOoWhvmaT8gXARnbRUs7mBL1mFFHMqGQ0YpwQ9ps=' 
WHERE 
  key_id = '26d607f4a4f337c512f530062f854a2809db786edd9d1fb0726f4b0316e48ada' 
  AND (
    token = 'JE8UOoWhvmaT8gXARnbRUs7mBL1mFFHMqGQ0YpwQ9ps=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031