UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'YhdYBeDqiE+/ko/duQWUb26EfFTcyKyUf4LNByF2DfA='
WHERE
key_id = '4133e8551bc6ee694c8e79dff6a9b1433cbf08391fa20b9ac58825936550512d'
AND (
token = 'YhdYBeDqiE+/ko/duQWUb26EfFTcyKyUf4LNByF2DfA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)