UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'BOyzwfp5lomML/4q2Un3JxumxCONdiMAF2BGMAwnTjw='
WHERE
key_id = '39389b1d1891e75b7c80cdd3b493be1414b9601b3d798c7cc5d3f815cf7e316a'
AND (
token = 'BOyzwfp5lomML/4q2Un3JxumxCONdiMAF2BGMAwnTjw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)