UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'pPeYLo2dc0X/vLdS9JFEX+geFTg6LtBxTCsTtu66Jjw='
WHERE
key_id = '1ab60fde9fb543066879d7eb2bf8fa92f1d9142395a07d8b7a8893552df315b0'
AND (
token = 'pPeYLo2dc0X/vLdS9JFEX+geFTg6LtBxTCsTtu66Jjw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)