UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '2ckqk8KBAwBvCHVo0WbxtmVaRusa2DKDXYJiUfCGOz0='
WHERE
key_id = 'bc30efabf48693446f53dfce900dc4cda085608a67a3b74d9f90a8cfb65f7f83'
AND (
token = '2ckqk8KBAwBvCHVo0WbxtmVaRusa2DKDXYJiUfCGOz0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)