UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'fTnK9iGqQa7KPwAkEDBZvC2odp/4uah7165YHsD3Iw4='
WHERE
key_id = 'f68e93310827792362156ca09a0670b4e326ba415cde4c4fa9f5647abecbf8a6'
AND (
token = 'fTnK9iGqQa7KPwAkEDBZvC2odp/4uah7165YHsD3Iw4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)