UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'PeTvyO+WFXLv5A1tzPNw/HbL1of1ELjGng01oqAGZqg=' 
WHERE 
  key_id = '4baf1ff3376128cf0514c2787915f9e26abd2c1a21a05fa8ab41723d7bcf682c' 
  AND (
    token = 'PeTvyO+WFXLv5A1tzPNw/HbL1of1ELjGng01oqAGZqg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00019