UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'JawJUAkgptbDVMxJK/7XMKDeWPhoyEoiW4HIdmvLDnA='
WHERE
key_id = 'bd7ede6f74d89ef05be90a041d42dd2735125f2611b9e53690a0a24bc434e5a1'
AND (
token = 'JawJUAkgptbDVMxJK/7XMKDeWPhoyEoiW4HIdmvLDnA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)