UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'NKh8/9zuvodjSPKi5iXeKoVHv+9Pk9YH5QOMALhVY88='
WHERE
key_id = '03b6c84772c55a4961d556ef2d18bd0da1b2f953f3fbefbb4a2fc3a22fa08b41'
AND (
token = 'NKh8/9zuvodjSPKi5iXeKoVHv+9Pk9YH5QOMALhVY88='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)