UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'VFrjkbgG130w0FWeLuAqoJ9PBnfKia3AlemaJwCySjA='
WHERE
key_id = 'd19641941ef1c564c7608e8710bddb8795c9d3b3023933681926614e8a0ed373'
AND (
token = 'VFrjkbgG130w0FWeLuAqoJ9PBnfKia3AlemaJwCySjA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)