UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'y097k/x/veqCVxRjDwCxI2Jc6e528VxHt+gXhRbpvak=' 
WHERE 
  key_id = 'c9b9572a882cc97179aa1c86f058f9dcf9b14342c7dbf769465333afa033270a' 
  AND (
    token = 'y097k/x/veqCVxRjDwCxI2Jc6e528VxHt+gXhRbpvak=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00050