UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'cnPp+QgYg7EXU0aximsiz5gNEg8GlflKKxoWh9Nr61Y='
WHERE
key_id = '841971a38e2879b5f97de09eacb1b6ea4d449b87a83721a8687f4818ddc5cd67'
AND (
token = 'cnPp+QgYg7EXU0aximsiz5gNEg8GlflKKxoWh9Nr61Y='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)