UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'NewbpJY+wyb2Bv9h8xGP6PYp3Xhl29Z6PWepGg18eHA=' 
WHERE 
  key_id = '2c1cd090cfd1372fd4aa872cecce9898b50fba080b121361cbf368e8a1921c93' 
  AND (
    token = 'NewbpJY+wyb2Bv9h8xGP6PYp3Xhl29Z6PWepGg18eHA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00035