UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'BSuKKt8gOTqZkHAk1znjUbvFsYaH9shpaKYdwY8D7JA='
WHERE
key_id = '996787670b125cbb8d909058161e7961a3b296f846fb3320652c67708889c04c'
AND (
token = 'BSuKKt8gOTqZkHAk1znjUbvFsYaH9shpaKYdwY8D7JA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)