UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '8g9bAhnl3/MI85e/ZhilB9u/GniegicMi710IrwHdow='
WHERE
key_id = '5604582218898f8833423692accdeab55389564e5818928cd80f2e51ac5676c2'
AND (
token = '8g9bAhnl3/MI85e/ZhilB9u/GniegicMi710IrwHdow='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)