UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'l/73gm6mgbrPA4jPiQTLPrbWP+YKP09nYD3wzTI1aBA=' 
WHERE 
  key_id = '4e6584e760fa47ea6743dd32fcb30b17124dfe9326323f23549757b553c89275' 
  AND (
    token = 'l/73gm6mgbrPA4jPiQTLPrbWP+YKP09nYD3wzTI1aBA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00035