UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'LI0zSHflGihwRzg3TYwNnuof/VClkgs4rZZYiAwmp4U='
WHERE
key_id = 'df856eee3f7b0b86ed3872093f0c27c74393a816d8f73e506a7eecdd80192126'
AND (
token = 'LI0zSHflGihwRzg3TYwNnuof/VClkgs4rZZYiAwmp4U='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)