UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'bqzU3ud67tzdmZVnbtmjmq2RNrT/L7Pgi5mGrPZFmlw=' 
WHERE 
  key_id = '1b1ae1328776fc021fcd5494792cda03b8c1fc3e3b9f916531be0c52d177f81d' 
  AND (
    token = 'bqzU3ud67tzdmZVnbtmjmq2RNrT/L7Pgi5mGrPZFmlw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00041