UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'AOOBwjpQGLU4BN5OGlPak4T31Yxj/OgIHLL0WFSgUwc='
WHERE
key_id = '69c70643936317afe5f797c0be114d62db622e4fc34b0431543ce479986c8d1e'
AND (
token = 'AOOBwjpQGLU4BN5OGlPak4T31Yxj/OgIHLL0WFSgUwc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)