UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'W/LxFKNW4/DZ8tjU7samduhiI2LDvEZWL2ZFBxmn1gg='
WHERE
key_id = '0e5166e3ce20b23e6c6a9d23988e4a02a77a3020ab612bceb8c27da3cca6778c'
AND (
token = 'W/LxFKNW4/DZ8tjU7samduhiI2LDvEZWL2ZFBxmn1gg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)