UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'L0QWSXil806h45fm1gMJ/i0vvs8+McRpI2WfUorzbh8='
WHERE
key_id = '86fb02785b66c7f8739278e4afb50a526e11bec1e196f50535545ee70362f6ae'
AND (
token = 'L0QWSXil806h45fm1gMJ/i0vvs8+McRpI2WfUorzbh8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)