UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '2sMhzEo08wCJzrZE7tzzC+BxBDUXeYRlSJG+JdNZCAg=' 
WHERE 
  key_id = 'b39e444e84ac30d4ce4d1b995c12fd8e506a4eb4901b5ae807141b5c8b453b34' 
  AND (
    token = '2sMhzEo08wCJzrZE7tzzC+BxBDUXeYRlSJG+JdNZCAg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00038