UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '9uIVkVhoSgYTavW+DDGLjdAHGQifKiJVQi40y7DYIgU='
WHERE
key_id = '009b8577578149423ccb48c338f9475338bd72bd047c0f7ff96bf48ea755eeba'
AND (
token = '9uIVkVhoSgYTavW+DDGLjdAHGQifKiJVQi40y7DYIgU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)