UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '3YI7ghZ7QUABeLSNFYKs5oPxv4IKVRWr5gDwOto0E/w='
WHERE
key_id = 'ee7a4a3090d8bd4d5a309c1d00406ca59ecc1c7283cf09adf3e0c68eddfb0fec'
AND (
token = '3YI7ghZ7QUABeLSNFYKs5oPxv4IKVRWr5gDwOto0E/w='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)