UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '39TJlew6/wphxldi5MP5fqdQafDEg8cCgKutVNb7u9A='
WHERE
key_id = 'ef35001a07a91ff4d0b3e2d8a3fa9755f33381429fbf72ff954a0613312caf5d'
AND (
token = '39TJlew6/wphxldi5MP5fqdQafDEg8cCgKutVNb7u9A='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)