UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'YJ01ja+jeaz4aUSU/96RD3ccWwU+CNXEkX4lBU7bQ9E=' 
WHERE 
  key_id = '5f92a6424dd23f2c43e82a7a539ea67b235944cab6c23a13745a8bd8a4f9fb00' 
  AND (
    token = 'YJ01ja+jeaz4aUSU/96RD3ccWwU+CNXEkX4lBU7bQ9E=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00073