UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'XZyMQRx4h8Tvo14DVUD8BURXbwq/TmJUOcOZKbH0uVQ=' 
WHERE 
  key_id = '6f06ef22da9f6b099233f9136a919b13a0bc773a0617875dad28d16355c6b617' 
  AND (
    token = 'XZyMQRx4h8Tvo14DVUD8BURXbwq/TmJUOcOZKbH0uVQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00035