UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '6H/j5WsYZy9mhGYwLdHxGqEiNtnxcL6mraYYHuhfZYo='
WHERE
key_id = '6426747160da4f62f115894eff82fd09c90ec502cd57d16d5a8e888e882d7d20'
AND (
token = '6H/j5WsYZy9mhGYwLdHxGqEiNtnxcL6mraYYHuhfZYo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)