UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'MI8O6dlXfh9Yn+UnXJ19Fq6DmxcEuYS34r4GC+Tf1tM='
WHERE
key_id = '3c9f46607e5e0fc12d4c5d354b20e3dd2ca7a114832e3120a78a7e51d1755cdc'
AND (
token = 'MI8O6dlXfh9Yn+UnXJ19Fq6DmxcEuYS34r4GC+Tf1tM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)