UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'n/brLYbFqeKkTY4j8H7/5BmfIKM4UFYdwsXocZKKBaU=' 
WHERE 
  key_id = 'fd1169a221316009b170f40b6b1b23252f5d482b6ad42e4a25a1659db05e5a15' 
  AND (
    token = 'n/brLYbFqeKkTY4j8H7/5BmfIKM4UFYdwsXocZKKBaU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00016