UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'QACXth1E7S1flB85ijPlOVQzoWWNU8xH/WAPL2CiHaQ='
WHERE
key_id = 'efb1bcd1275efdf8695f01b43bd719acdd712f0f0456a88dc1f26687e713e07a'
AND (
token = 'QACXth1E7S1flB85ijPlOVQzoWWNU8xH/WAPL2CiHaQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)