UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'H2LGTIfaaQpfq3Mry/OBdOuShMrtalXaENCksXkA7v4='
WHERE
key_id = 'c0d04033ccc5ce2b456298c6157ecd5b7cab344ddbd052d570868e12b3e70c64'
AND (
token = 'H2LGTIfaaQpfq3Mry/OBdOuShMrtalXaENCksXkA7v4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)