UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'UvbfTlYKhrZmO8x/4m6j4wovWlyaZrjpkUBIgAREkm4='
WHERE
key_id = '5c3feb0e1271f3d8342fa1363f278b59e1d0823be182df26dc591e87c69399ae'
AND (
token = 'UvbfTlYKhrZmO8x/4m6j4wovWlyaZrjpkUBIgAREkm4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)