UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '8J6a+n9QPgJWyz/7Y3j0I94uN/wrBoIJO0UEQX3FOwo='
WHERE
key_id = '76b80860bdcf445e74f66701a1d41a4a2e6d30351328f29895083d5b8fef5902'
AND (
token = '8J6a+n9QPgJWyz/7Y3j0I94uN/wrBoIJO0UEQX3FOwo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)