UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'o7yb8vUr9kuU8PEGTJXFFF9birrpxNaezi9wjW/IGWw='
WHERE
key_id = '1510dfd01f389d7fa36a7932618225b034383dbff122abe6315d341ad7f22393'
AND (
token = 'o7yb8vUr9kuU8PEGTJXFFF9birrpxNaezi9wjW/IGWw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)