UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ozqW35+bZUXAh67piB0Rxks17MDPIRIv7unLLdHRncU='
WHERE
key_id = 'e4f222f88ee30fdb6cfd64adc3e81c1127b17e9b93722ff94dc197149c043e5f'
AND (
token = 'ozqW35+bZUXAh67piB0Rxks17MDPIRIv7unLLdHRncU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)