UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '3p+2KzBg8fW2QGj2vx+zdwH1ldLJPdlnDfHGM/xe4nU='
WHERE
key_id = 'cf57be7cc00d5067867089028555bdb135052102d2873797c599ee6bc7d7d9fe'
AND (
token = '3p+2KzBg8fW2QGj2vx+zdwH1ldLJPdlnDfHGM/xe4nU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)