UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'VnPb5yc6BpTGyUVJAmPAQhEsoAND+GXZVir7tsDV130='
WHERE
key_id = 'dfd0cc599ccfb7a2ebfa56ca83e8bb4606e93ba33b0e1965bdefcf96f5a70571'
AND (
token = 'VnPb5yc6BpTGyUVJAmPAQhEsoAND+GXZVir7tsDV130='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)