UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Av1OpEGlWj/Mk1dtJJsKyEGZ6uYbCRtUuv7PiJps4cU='
WHERE
key_id = 'a66949c3ad95a6956de8f0790506c551596cc3c124cf1a8009f900eef50778ac'
AND (
token = 'Av1OpEGlWj/Mk1dtJJsKyEGZ6uYbCRtUuv7PiJps4cU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)