UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'oUDSEoTxKmLm13AnGB4RoPD8PfYtXeZKySac5cWseiE='
WHERE
key_id = 'df055ed719cdcf1173dd5e407a5f03e30c1c52cf63ef820f10201165f7c9c181'
AND (
token = 'oUDSEoTxKmLm13AnGB4RoPD8PfYtXeZKySac5cWseiE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)