UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'J3jTGSxNFHd3xXyGI8sY5odZBow+Alxjwtv5I2TnPY8='
WHERE
key_id = 'acf288bc57a22e970c09a3f596de735812d337415bdc12790a17d768cdcbcbfa'
AND (
token = 'J3jTGSxNFHd3xXyGI8sY5odZBow+Alxjwtv5I2TnPY8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)